#Formulaire d'inscription avec gestion des erreurs de validation 
{% block field_row %}
{% spaceless %}

    {% if errors|length > 0 %}
    
    <div class="control-group error">
        {{ form_label(form)}}
        <div class="controls">
            {{ form_widget(form , { 'attr': {'class': 'span4'} }) }}
            {% block field_errors %}
            {% spaceless %}
                {% for error in errors %}
                    <span class="help-inline">{{ error.messageTemplate|trans(error.messageParameters, 'validators') }}</span>
                {% endfor %}
            {% endspaceless %}
            {% endblock field_errors %}
        </div>
    </div>
    
    {% else %}
    
    <div class="control-group">
        {{ form_label(form)}}
        <div class="controls">
                {{ form_widget(form , { 'attr': {'class': 'span4'} }) }}
        </div>
    </div>
    
    {% endif %}
{% endspaceless %}
{% endblock field_row %}